|
Download
FAQ History |
|
API
Search Feedback |
Updating Web Modules
During development, you will often need to make changes to Web applications. After you have made the changes and want to run the modified application, you must:
To try this feature, first build and deploy the
hello2application. A samplehello2.waris provided in<INSTALL>/j2eetutorial14/examples/web/provided-wars/.
- In a terminal window, go to
<INSTALL>/j2eetutorial14/examples/web/hello2/.- Run
asantbuild. The default target will copy the JSP pages to the<INSTALL>/j2eetutorial14/examples/web/hello2/build/directory.- Start
deploytool.- Create a Web application called
hello2by running the New Web Application Wizard. Select FileNew
Web Application WAR.
- New Web Application Wizard
- Select the Create New Stand-Alone WAR Module radio button.
- Click Browse and in the file chooser, navigate to
<INSTALL>/j2eetutorial14/examples/web/hello2/.- In the File Name field, enter
hello2.- Click Choose Module File.
- In the WAR Display Name field enter
hello2.- In the Context Root field, enter
/hello2.- Click Edit to add the content files.
- In the Edit Contents dialog, navigate to
<INSTALL>/j2eetutorial14/examples/web/hello2/build/. Selectduke.waving.gif,greeting.jsp, andresponse.jspand click Add. Click OK.- Click Next.
- Select the JSP radio button.
- Click Next.
- Select
greeting.jspfrom the Servlet Class combo box.- Click Finish.
- Add an alias to the greeting Web component.
- Select File
Save.
- Deploy the WAR.
- Open your browser to http://localhost:1024/hello2/greeting
Open the file
<INSTALL>/j2eetutorial14/examples/web/hello2/greeting.jspin an editor and change the greeting returned bygreeting.jspto be:To update the Web application:
- Run
asantbuild. This task copies the modified JSP page into thebuilddirectory.- Select the
hello2WAR.- Select Tools
Update. A popup dialog will display the modified file. Click OK.
- Select File
Save.
- Select Tools
Deploy. A popup dialog will query whether you want to redeploy. Click Yes.
- In the Deployment Managers dialog, enter the user name and password you specified when you installed the J2EE 1.4 Application Server.
- Click OK.
- A popup dialog will display the results of the deployment. Click Close.
- Reload the URL in the browser.
You should see the screen in Figure 3-3 in the browser:
![]()
|
Download
FAQ History |
|
API
Search Feedback |
All of the material in The J2EE 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.